#include <iostream>
#include <vector>
#include <cmath>
using namespace std;

const int MOD = 9901;

// 快速幂算法
long long power(long long base, long long exp, long long mod) {
    long long result = 1;
    base %= mod;
    while (exp > 0) {
        if (exp & 1) {
            result = (result * base) % mod;
        }
        base = (base * base) % mod;
        exp >>= 1;
    }
    return result;
}

// 扩展欧几里得算法求逆元
long long modInverse(long long a, long long mod) {
    long long m0 = mod;
    long long y = 0, x = 1;
    
    if (mod == 1) return 0;
    
    while (a > 1) {
        long long q = a / mod;
        long long t = mod;
        
        mod = a % mod;
        a = t;
        t = y;
        
        y = x - q * y;
        x = t;
    }
    
    if (x < 0) x += m0;
    
    return x;
}

// 计算等比数列求和：1 + p + p^2 + ... + p^k
long long geometricSum(long long p, long long k, long long mod) {
    if (k == 0) return 1;
    
    // 如果 p % mod == 1，那么等比数列的和就是 k+1
    if (p % mod == 1) {
        return (k + 1) % mod;
    }
    
    // 使用等比数列求和公式：S = (p^(k+1) - 1) / (p - 1)
    long long numerator = (power(p, k + 1, mod) - 1 + mod) % mod;
    long long denominator = modInverse(p - 1, mod);
    
    return (numerator * denominator) % mod;
}

int main() {
    int a, b;
    cin >> a >> b;
    
    if (a == 0) {
        cout << 0 << endl;
        return 0;
    }
    
    // 对 a 进行质因数分解
    vector<pair<int, int>> factors;
    int temp = a;
    
    for (int i = 2; i * i <= temp; i++) {
        if (temp % i == 0) {
            int count = 0;
            while (temp % i == 0) {
                temp /= i;
                count++;
            }
            factors.push_back({i, count});
        }
    }
    
    if (temp > 1) {
        factors.push_back({temp, 1});
    }
    
    // 计算 a^b 的因子和
    long long result = 1;
    for (auto& factor : factors) {
        int p = factor.first;
        int k = factor.second * b;  // 在 a^b 中，指数变为原来的 b 倍
        
        // 对于每个质因数，计算等比数列的和
        long long sum = geometricSum(p, k, MOD);
        result = (result * sum) % MOD;
    }
    
    cout << result << endl;
    
    return 0;
}